import machine
from mpu6050 import MPU6050
import time
import math
 
mpu=MPU6050(14,2) #(sclpin,sdapin)
mpu.MPU_Init()
#G = 9.8
while 1:
    gyro=mpu.MPU_Get_Gyroscope()
    accel=mpu.MPU_Get_Accelerometer()
    print('MPU_Get_Gyroscope=',gyro[0],gyro[1],gyro[2])
    #print('MPU_Get_Accelerometer=',accel[0],accel[1],accel[2])
    #print(math.atan(accel[1] / accel[2])/math.pi*180,'  ',accel[2])
    time.sleep_ms(1000)
